package com.eling.elcms.travel.service.impl;

import com.eling.elcms.travel.model.RoomRegister;
import com.eling.elcms.travel.model.TravelContract;
import com.eling.elcms.travel.model.view.SettlementsResult;
import com.eling.elcms.travel.service.ISettlementsRule;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.stereotype.Service;

import java.util.Date;

/**
 * 8%福利卷返现规则
 * @author Lina
 * 规则 ：每满一年分别对应给予价值合同单价8%的福利消费券
 */
@Service
public class EightCouponServiceImpl implements ISettlementsRule {
	
	private static final Log log = LogFactory.getLog(EightCouponServiceImpl.class);

	@Override
	public SettlementsResult calculate(RoomRegister room, TravelContract contract, Date start, Date end) {
		log.debug("EightCashbackServiceImpl");
		
		SettlementsResult result = new SettlementsResult();
		
		// 福利卷返现  = 产品价格 * 8%
		result.setMoney(contract.getPrice() * 0.08d);
		
		return result;
	}
	
}
